package com.lxq.web.servlet.common;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;


public class BaseServlet extends HttpServlet {
	private static final long serialVersionUID = 1L;
	protected void doGet(HttpServletRequest request,
			HttpServletResponse response) throws ServletException, IOException {
		doPost(request, response);
	}

	
	protected void doPost(HttpServletRequest request,
			HttpServletResponse response) throws ServletException, IOException {
		String method = request.getParameter("method");
		switch (method) {
		case "findphone":
			doFindphone(request, response);
			break;
		case "update":
			doUpdate(request, response);
			break;
		case "list":
			doList(request, response);
			break;
		case "delete":
			doDelete(request, response);
			break;
		case "add":
			doAdd(request, response);
			break;
		case "findone":
			doFindOne(request, response);
			break;
		case "edit":
			doEdit(request, response);
			break;
		default:
			response.sendRedirect(request.getContentType()+"/mng/404.jsp");
		}
	}

	public void doFindphone(HttpServletRequest request,
			HttpServletResponse response) throws ServletException, IOException {
		
	}
	
	public void doUpdate(HttpServletRequest request,
			HttpServletResponse response) throws ServletException, IOException {
		
	}
	
	public void doList(HttpServletRequest request,
			HttpServletResponse response) throws ServletException, IOException {
		
	}
	public void doAdd(HttpServletRequest request,
			HttpServletResponse response) throws ServletException, IOException {
		
	}
	public void doDelete(HttpServletRequest request,
			HttpServletResponse response) throws ServletException, IOException {
		
	}
	public void doFindOne(HttpServletRequest request,
			HttpServletResponse response) throws ServletException, IOException {
		
	}
	public void doEdit(HttpServletRequest request,
			HttpServletResponse response) throws ServletException, IOException {
		
	}
	
}
